package com.miyake.dsp.converter;

import com.miyake.dsp.ComplexArray;
import com.miyake.dsp.Processor;
import com.miyake.dsp.ScilabExecute;

public class OffsetImplScilab implements Processor {

	private ComplexArray source;
	private OffsetSetting setting;

	public OffsetImplScilab(OffsetSetting setting) {
		this.setting = setting;
	}
	
	@Override
	public void setSource(ComplexArray source) {
		this.source = source;
	}

	@Override
	public ComplexArray getSource() {
		return this.source;
	}

	@Override
	public ComplexArray getProcessed() {
		String command = "ret=data1+" + String.valueOf(setting.getOffset()) + ";";
		return ScilabExecute.execute(command, source, "ret");
	}

	@Override
	public Object getSetting() {
		return setting;
	}

}
